﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCultivation.API.AddliCation.BuildingD;
using SheepCultivation.Common.Domain.Week2;
using SheepCultivation.Common.Dto;
using SheepCultivation.Enum;

namespace SheepCultivation.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BuildingsController : ControllerBase
    {
        public readonly IMediator mediator;

        public BuildingsController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        #region 栋舍新增
        /// <summary>
        /// 栋舍信息新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BuildingAdd")]
        public async Task<Result> Handle(BuildingCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 栋舍信息 显示
        /// <summary>
        /// 栋舍信息显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BuildingList")]
        public async Task<Result> Handle(BuildingSeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 栋舍类型 新增
        /// <summary>
        /// 栋舍类型新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BuildingTypeAdd")]
        public async Task<Result> Handle(BuildingTypeCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 下拉框 栋舍类型
        /// <summary>
        /// 下拉框 栋舍类型
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BuildingTypeBind")]
        public async Task<Result> Handle(BuildingTypeSeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 下拉框 栏位
        /// <summary>
        /// 下拉框 栏位
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("ColumnsList")]
        public async Task<Result> Handle(ColumnsSeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 栏位信息显示列表
        /// <summary>
        /// 栏位信息显示列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("ColumnsLists")]
        public async Task<Result> Handle(ColumnsSeachListCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 栏位新增
        /// <summary>
        /// 栏位新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("ColumnsAdds")]
        public async Task<Result> Handle(ColumnsCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

    }
}
